-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs(start): add Docker with Bun and improved Cloudflare setup for hosting guide #4898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughDocumentation for React hosting was expanded and revised: Cloudflare deployment now references Workers via wrangler.jsonc with updated compatibility dates, a “Deploy to Cloudflare” button was added, and comprehensive Docker-based deployment guidance (Dockerfile, Compose, Coolify notes) was introduced, including ports, entrypoint, and build output specifics. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (5)
docs/start/framework/react/hosting.md (5)
168-175
: Use stable React 19 tags instead of RCSuggest installing the stable React 19 instead of the RC channel to avoid pulling pre-release builds.
Apply this diff to update the command:
-```sh -npm install react@rc react-dom@rc -``` +```sh +npm install react@^19 react-dom@^19 +```If you want to include Bun users, we can add an additional example with:
bun add react@^19 react-dom@^19
.
232-234
: Remove build flag that may not be forwardedDepending on your package.json scripts, passing
--config vite.config.ts
tobun run build
may not be forwarded to Vite/TanStack Start. The build already picks upvite.config.ts
by default.Apply this diff:
-ENV NODE_ENV=production -RUN bun run build --config vite.config.ts +ENV NODE_ENV=production +RUN bun run build
239-242
: Optional: avoid installing curl in the runtime imageInstalling curl increases image size and surface area. If you don’t need container-native health checks, omit curl and the HEALTHCHECK. Alternatively, use a smaller HTTP probe (for example, BusyBox’s wget) or rely on platform-level checks.
We can provide a slimmer variant if you prefer.
261-263
: Prefer CMD and run the entry directly (not via “bun run”)Using CMD makes overriding easier at runtime, and invoking the file directly avoids npm-script indirection.
Apply this diff:
-# Start the Bun server (SSR entry emitted by TanStack Start) -ENTRYPOINT ["bun", "run", ".output/server/index.mjs"] +# Start the Bun server (SSR entry emitted by TanStack Start) +CMD ["bun", ".output/server/index.mjs"]If you need ENTRYPOINT, consider:
- ENTRYPOINT ["bun"]
- CMD [".output/server/index.mjs"]
96-104
: Nit: consider phrasing around compatibility_dateCloudflare recommends pinning compatibility_date to a specific day for predictability. You might add a short note to encourage teams to set this to their project’s creation date and bump intentionally.
Happy to draft the sentence if you want to include it.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/start/framework/react/hosting.md
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/start/framework/react/hosting.md
[grammar] ~38-~38: There might be a mistake here.
Context: ...e-workers): Deploy to Cloudflare Workers - node-server
: Deploy to a Node.js server - [bun
](#...
(QB_NEW_EN)
[grammar] ~39-~39: There might be a mistake here.
Context: ...r](#nodejs): Deploy to a Node.js server - [
bun](#bun): Deploy to a Bun server - [
docker`](#d...
(QB_NEW_EN)
[grammar] ~40-~40: There might be a mistake here.
Context: ... - bun
: Deploy to a Bun server - docker
: Deploy using Docker - ... and more to ...
(QB_NEW_EN)
[grammar] ~41-~41: There might be a mistake here.
Context: ...docker
: Deploy using Docker - ... and more to come! Once you've chose...
(QB_NEW_EN)
[grammar] ~137-~137: There might be a mistake here.
Context: ...ensible defaults so deployments succeed. - For more, see the official docs: [Deploy...
(QB_NEW_EN)
[grammar] ~289-~289: There might be a mistake here.
Context: ...e at http://localhost:8080
. > [!NOTE] > If you're also running a database or o...
(QB_NEW_EN)
[grammar] ~294-~294: There might be a mistake here.
Context: ...Optional: docker-compose.yaml > [!NOTE] > Use docker-compose.yaml
when your Ta...
(QB_NEW_EN)
[grammar] ~334-~334: There might be a mistake here.
Context: ...ose (recommended for multi‑service apps) - Create a new service → Docker Compose → ...
(QB_NEW_EN)
[grammar] ~335-~335: There might be a mistake here.
Context: ...rvice → Docker Compose → Build from Git. - Connect your repo and branch; ensure the...
(QB_NEW_EN)
[grammar] ~337-~337: There might be a mistake here.
Context: ...n a subfolder (for example /apps/web
). - Keep databases (for example Postgres on ...
(QB_NEW_EN)
[grammar] ~338-~338: There might be a mistake here.
Context: ...a service names (for example db:5432
). - Set environment variables on the app
s...
(QB_NEW_EN)
[grammar] ~344-~344: There might be a mistake here.
Context: ...le (recommended for single‑service apps) - Create a new service → Docker → Build fr...
(QB_NEW_EN)
[grammar] ~345-~345: There might be a mistake here.
Context: ... use a pre‑built image from a registry). - Connect your repo and branch; verify `Do...
(QB_NEW_EN)
[grammar] ~346-~346: There might be a mistake here.
Context: ...ckerfilepath (usually
./Dockerfile`). - In Build Pack, select Dockerfile (Coolif...
(QB_NEW_EN)
[grammar] ~347-~347: There might be a mistake here.
Context: ...Directory if your app is in a subfolder. - Set environment variables: `NODE_ENV=pro...
(QB_NEW_EN)
[grammar] ~353-~353: There might be a mistake here.
Context: ...ost port (for example 8080
) to 5173
. - Set HOST=0.0.0.0
so the server binds t...
(QB_NEW_EN)
[grammar] ~356-~356: There might be a mistake here.
Context: ...balances stability and security updates. - Using a database? If Postgres is part of...
(QB_NEW_EN)
[grammar] ~357-~357: There might be a mistake here.
Context: ...for example Redis 6379
, MySQL 3306
). - If your database lives in a different Co...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.17.2)
docs/start/framework/react/hosting.md
357-357: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 1
(MD005, list-indent)
357-357: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
358-358: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 2
(MD005, list-indent)
358-358: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
🔇 Additional comments (6)
docs/start/framework/react/hosting.md (6)
38-41
: Good call replacing Pages with Cloudflare Workers and adding Docker targetAnchor links match the section IDs and the targets look consistent with the guidance below.
96-111
: Wrangler JSONC example looks correctFields and paths align with a module Worker setup and TanStack Start output locations.
114-124
: TOML alternative is validThe TOML variant mirrors JSONC correctly, including assets binding and nodejs_compat.
128-139
: Deploy button guidance is accurateClear caveat about Workers-only support, and the link format is correct.
251-256
: Ports and binding are clearExplicitly exposing 5173 and setting HOST/PORT matches the rest of the doc and run instructions.
281-285
: Run instructions match Dockerfile configurationPort mapping and envs are consistent with the Dockerfile and the app’s default PORT.
- Use the `oven/bun` image tag that matches your Bun version. Pinning a minor series (for example `1.2.19`) balances stability and security updates. | ||
- Using a database? If Postgres is part of your deployment, ensure the app can reach port `5432` (prefer internal networking). Avoid exposing databases publicly; for local access map `5432:5432`. Apply the same guidance for other services (for example Redis `6379`, MySQL `3306`). | ||
- If your database lives in a different Coolify stack, enable “Connect to Predefined Network” and reference the database service by its full stack-aware name. Otherwise, keep all services in the same compose stack to use the default internal network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Markdown list indentation (lint errors MD005/MD007)
Inconsistent indentation on these bullets triggers markdownlint. Align them to the top-level list.
Apply this diff:
-- - Using a database? If Postgres is part of your deployment, ensure the app can reach port `5432` (prefer internal networking). Avoid exposing databases publicly; for local access map `5432:5432`. Apply the same guidance for other services (for example Redis `6379`, MySQL `3306`).
-- - If your database lives in a different Coolify stack, enable “Connect to Predefined Network” and reference the database service by its full stack-aware name. Otherwise, keep all services in the same compose stack to use the default internal network.
+- Using a database? If Postgres is part of your deployment, ensure the app can reach port `5432` (prefer internal networking). Avoid exposing databases publicly; for local access map `5432:5432`. Apply the same guidance for other services (for example Redis `6379`, MySQL `3306`).
+- If your database lives in a different Coolify stack, enable “Connect to Predefined Network” and reference the database service by its full stack-aware name. Otherwise, keep all services in the same compose stack to use the default internal network.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- Use the `oven/bun` image tag that matches your Bun version. Pinning a minor series (for example `1.2.19`) balances stability and security updates. | |
- Using a database? If Postgres is part of your deployment, ensure the app can reach port `5432` (prefer internal networking). Avoid exposing databases publicly; for local access map `5432:5432`. Apply the same guidance for other services (for example Redis `6379`, MySQL `3306`). | |
- If your database lives in a different Coolify stack, enable “Connect to Predefined Network” and reference the database service by its full stack-aware name. Otherwise, keep all services in the same compose stack to use the default internal network. | |
- Use the `oven/bun` image tag that matches your Bun version. Pinning a minor series (for example `1.2.19`) balances stability and security updates. | |
- Using a database? If Postgres is part of your deployment, ensure the app can reach port `5432` (prefer internal networking). Avoid exposing databases publicly; for local access map `5432:5432`. Apply the same guidance for other services (for example Redis `6379`, MySQL `3306`). | |
- If your database lives in a different Coolify stack, enable “Connect to Predefined Network” and reference the database service by its full stack-aware name. Otherwise, keep all services in the same compose stack to use the default internal network. |
🧰 Tools
🪛 LanguageTool
[grammar] ~356-~356: There might be a mistake here.
Context: ...balances stability and security updates. - Using a database? If Postgres is part of...
(QB_NEW_EN)
[grammar] ~357-~357: There might be a mistake here.
Context: ...for example Redis 6379
, MySQL 3306
). - If your database lives in a different Co...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.17.2)
357-357: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 1
(MD005, list-indent)
357-357: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
358-358: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 2
(MD005, list-indent)
358-358: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
🤖 Prompt for AI Agents
In docs/start/framework/react/hosting.md around lines 356-358, the bulleted list
has inconsistent indentation causing markdownlint MD005/MD007; fix by aligning
all list items to the same top-level indentation (remove the extra space before
the second and third bullets so they start at the same column as the first),
ensuring consistent use of a single space after each dash and preserving inline
code and examples.
Summary
What changed
wrangler.jsonc
example and Deploy to Cloudflare button notesDockerfile
,.dockerignore
, optionaldocker-compose.yaml
, and Coolify notesWhy
How to test
target: 'bun'
invite.config.ts
docker build -t my-tanstack-start-app .
docker run --rm -p 8080:5173 -e HOST=0.0.0.0 -e PORT=5173 my-tanstack-start-app
http://localhost:8080
Notes
wrangler.jsonc
over TOMLPORT
default 5173Breaking changes
Summary by CodeRabbit